from django.urls import path
from apps.users.views import UsernameCountView,MobileCountView,RegisterView
from apps.users.views import LoginView,LogoutView,UserCenterView,EmailView,EmailVerificationView
from apps.users.views import CreateAddressView,AddressListView
from apps.users.views import UpdateDestroyAddressView,DefaultAddressView
from apps.users.views import UpdateTitleAddressView,UserHistoryView
from apps.users.views import ChangePasswordView

urlpatterns = [
    # 判断用户名是否重复
    # 通过<变量名>　来获取　请求参数
    path('usernames/<usercount:username>/count/', UsernameCountView.as_view()),
    # 判断手机号是否重复
    path('mobiles/<pc:mobile>/count/', MobileCountView.as_view()),
    # 注册的
    path('register/', RegisterView.as_view()),
    # 登录
    path('login/', LoginView.as_view()),
    # 退出
    path('logout/',LogoutView.as_view()),
    # 个人中心
    path('info/',UserCenterView.as_view()),
    # 更新邮箱信息
    path('emails/', EmailView.as_view()),
    # 邮件激活
    path('emails/verification/',EmailVerificationView.as_view()),
    # 新增收货地址
    path('addresses/create/',CreateAddressView.as_view()),
    # 获取收货地址
    path('addresses/',AddressListView.as_view()),
    # 修改收货地址
    path('addresses/<address_id>/',UpdateDestroyAddressView.as_view()),
    # 设置默认地址
    path('addresses/<address_id>/default/',DefaultAddressView.as_view()),
    # 设置标题
    path('addresses/<address_id>/title/',UpdateTitleAddressView.as_view()),
    # 新增用户浏览记录
    path('browse_histories/',UserHistoryView.as_view()),
    # 修改密码
    path('password/',ChangePasswordView.as_view()),

]


